﻿using SuperSocket.SocketBase.Protocol;
using SuperSocket.SocketBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WPF_SocketServer_Demo.Session;
using WPF_SocketServer_Demo.ReceiveFilter;
using WPF_SocketServer_Demo.RequestInfo;
using System.Configuration;
using System.Timers;
using SuperSocket.SocketBase.Config;

namespace WPF_SocketServer_Demo.Server
{
    public class MyServer : AppServer<MySession,DTRequestInfo>
    {
        public MyServer() : base(new DefaultReceiveFilterFactory<MyReceiveFilter, DTRequestInfo>())
        {

        }

        protected override void OnNewSessionConnected(MySession session)
        {
            Console.WriteLine("New session connected: " + session.RemoteEndPoint);
            base.OnNewSessionConnected(session);
        }

        protected override void OnSessionClosed(MySession session, CloseReason reason)
        {
            Console.WriteLine("Session closed: " + session.RemoteEndPoint);
            base.OnSessionClosed(session, reason);
        }
    }
}
